package me.shiqiang.im.microservice;

import me.shiqiang.im.microservice.impl.DistributorMicroServiceHyStrix;
import me.shiqiang.im.microservice.returnobj.UserKeyReturnObj;
import me.shiqiang.im.microservice.returnobj.UserKeysReturnObj;
import me.shiqiang.im.microservice.returnobj.UsersInfoPagerReturnObj;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Created by John on 2018/1/2.
 */
@FeignClient(name = "service-distributor-query", fallback = DistributorMicroServiceHyStrix.class)
public interface DistributorMicroService {
    @RequestMapping(method = RequestMethod.GET, value = "/distributor-query/direct/un-del/userkeys")
    UserKeysReturnObj fetchDirectUserkeys(@RequestParam("currentPage") int currentPage, @RequestParam("pageSize") int pageSize, @RequestParam("parentUserKey") String parentUserKey);

    @RequestMapping(method = RequestMethod.GET, value = "/distributor-query/parent/uuid/by/{uuid}")
    UserKeyReturnObj fetchParentUserKey(@RequestParam("uuid") String uuid);


    @RequestMapping(method = RequestMethod.GET, value = "/distributor-query/list/user-by-age")
    UsersInfoPagerReturnObj fetchUsersByDate(@RequestParam("currentPage") int currentPage, @RequestParam("pageSize") int pageSize,
                                             @RequestParam("birthYearStart") int birthYearStart,
                                             @RequestParam("birthYearEnd") int birthYearEnd,
                                             @RequestParam("familyCode") String familyCode,
                                             @RequestParam("joinDateStart") String joinDateStart,
                                             @RequestParam("joinDateEnd") String joinDateEnd);

}
